﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DTO;

namespace QuanLyNhaHang
{
    public partial class MainForm : Form
    {
        public static DTOUser currentuser = null;
        public MainForm(DTOUser user)
        {
            InitializeComponent();
            currentuser = user;
        }

        private void thoátToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
            if (currentuser.usertype == "admin")
            {
                nhânViênTiếpTânToolStripMenuItem.Visible = false;
            }
            else
            {
                nhânViênQuảnLýToolStripMenuItem.Visible = false;
            }
        }

        private void quảnLýNhàCungCấpToolStripMenuItem_Click(object sender, EventArgs e)
        {
            QLNhaCungCap ncc = new QLNhaCungCap();
            ncc.MdiParent = this;
            ncc.StartPosition = FormStartPosition.CenterScreen;
            ncc.Show();
        }

        private void quảnLýNguyênVậtLiệuToolStripMenuItem_Click(object sender, EventArgs e)
        {
            QLNguyenVatLieu qlnvl = new QLNguyenVatLieu();
            qlnvl.MdiParent = this;
            qlnvl.StartPosition = FormStartPosition.CenterScreen;
            qlnvl.Show();           
        }

        private void quảnLýNhânViênToolStripMenuItem_Click(object sender, EventArgs e)
        {
            QLNhanVien qlnv = new QLNhanVien();
            qlnv.MdiParent = this;
            qlnv.Show();
        }

        private void quanrToolStripMenuItem_Click(object sender, EventArgs e)
        {
            QLLoaiNVL loainvl = new QLLoaiNVL();
            loainvl.MdiParent = this;
            loainvl.Show();
        }

        private void quảnLýQuốcGiaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            QLQuocGia qlqg = new QLQuocGia();
            qlqg.MdiParent = this;
            qlqg.Show();
        }

        private void quảnLýKháchHàngToolStripMenuItem_Click(object sender, EventArgs e)
        {
            QLKhachHang qlkh = new QLKhachHang();
            qlkh.MdiParent = this;
            qlkh.Show();
        }

        private void xuấtPhiếuNhậpNguyênVậtLiệuToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var obj = new QLPhieuNhap();            
            obj.MdiParent = this;
            obj.StartPosition = FormStartPosition.CenterScreen;
            obj.Show();
        }

        private void quảnLýBánHàngToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var obj = new QLBanHang();
            obj.MdiParent = this;
            obj.StartPosition = FormStartPosition.CenterScreen;
            obj.Show();
        }

        private void banHànhCácChínhSáchKhuyếnMãiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var obj = new QLKhuyenMai();
            obj.MdiParent = this;
            obj.StartPosition = FormStartPosition.CenterScreen;
            obj.Show();
        }

        private void quảnLýMónĂnToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var obj = new QLMonAn();
            obj.MdiParent = this;
            obj.StartPosition = FormStartPosition.CenterScreen;
            obj.Show();
        }

        private void báoCáoThốngKêToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var obj = new BaoCaoThongKe();
            obj.MdiParent = this;
            obj.StartPosition = FormStartPosition.CenterScreen;
            obj.Show();
        }
    }
}
